<%--
  Created by IntelliJ IDEA.
  User: hasee
  Date: 2017/9/27
  Time: 19:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登陆页面</title>
</head>
<%
    String error = "";
    String temp = (String) request.getAttribute("error");
    if(temp != null){
        error = temp;
    }

    String username="";
    Cookie[] cookies = request.getCookies();
    for (Cookie cookie:cookies) {
        if("username".equals(cookie.getName())){
            username = cookie.getValue();
        }
    }
%>
<p style="color: red"><%= error%></p>
<form action="/web/loginServlet" method="post">
    <table>
        <tr>
            <td colspan="2" align="center"><h1>登陆</h1></td>
        </tr>
        <tr>
            <td>用户名:</td>
            <td><input type="text" name="username" value="<%= username%>"></td>
        </tr>
        <tr>
            <td>密码:</td>
            <td><input type="password" name="password" value=""></td>
        </tr>
        <tr>
            <td colspan="2" align="center"><button>登陆</button></td>
        </tr>
    </table>
</form>
<body>

</body>
</html>
